# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AppEngine.V1.Model.Instance do
  @moduledoc """
  An Instance resource is the computing unit that App Engine uses to automatically scale an application.

  ## Attributes

  *   `appEngineRelease` (*type:* `String.t`, *default:* `nil`) - Output only. App Engine release this instance is running on.
  *   `availability` (*type:* `String.t`, *default:* `nil`) - Output only. Availability of the instance.
  *   `averageLatency` (*type:* `integer()`, *default:* `nil`) - Output only. Average latency (ms) over the last minute.
  *   `errors` (*type:* `integer()`, *default:* `nil`) - Output only. Number of errors since this instance was started.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Output only. Relative name of the instance within the version. Example: instance-1.
  *   `memoryUsage` (*type:* `String.t`, *default:* `nil`) - Output only. Total memory in use (bytes).
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Full path to the Instance resource in the API. Example: apps/myapp/services/default/versions/v1/instances/instance-1.
  *   `qps` (*type:* `number()`, *default:* `nil`) - Output only. Average queries per second (QPS) over the last minute.
  *   `requests` (*type:* `integer()`, *default:* `nil`) - Output only. Number of requests since this instance was started.
  *   `startTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time that this instance was started.@OutputOnly
  *   `vmDebugEnabled` (*type:* `boolean()`, *default:* `nil`) - Output only. Whether this instance is in debug mode. Only applicable for instances in App Engine flexible environment.
  *   `vmId` (*type:* `String.t`, *default:* `nil`) - Output only. Virtual machine ID of this instance. Only applicable for instances in App Engine flexible environment.
  *   `vmIp` (*type:* `String.t`, *default:* `nil`) - Output only. The IP address of this instance. Only applicable for instances in App Engine flexible environment.
  *   `vmLiveness` (*type:* `String.t`, *default:* `nil`) - Output only. The liveness health check of this instance. Only applicable for instances in App Engine flexible environment.
  *   `vmName` (*type:* `String.t`, *default:* `nil`) - Output only. Name of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.
  *   `vmStatus` (*type:* `String.t`, *default:* `nil`) - Output only. Status of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.
  *   `vmZoneName` (*type:* `String.t`, *default:* `nil`) - Output only. Zone where the virtual machine is located. Only applicable for instances in App Engine flexible environment.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :appEngineRelease => String.t() | nil,
          :availability => String.t() | nil,
          :averageLatency => integer() | nil,
          :errors => integer() | nil,
          :id => String.t() | nil,
          :memoryUsage => String.t() | nil,
          :name => String.t() | nil,
          :qps => number() | nil,
          :requests => integer() | nil,
          :startTime => DateTime.t() | nil,
          :vmDebugEnabled => boolean() | nil,
          :vmId => String.t() | nil,
          :vmIp => String.t() | nil,
          :vmLiveness => String.t() | nil,
          :vmName => String.t() | nil,
          :vmStatus => String.t() | nil,
          :vmZoneName => String.t() | nil
        }

  field(:appEngineRelease)
  field(:availability)
  field(:averageLatency)
  field(:errors)
  field(:id)
  field(:memoryUsage)
  field(:name)
  field(:qps)
  field(:requests)
  field(:startTime, as: DateTime)
  field(:vmDebugEnabled)
  field(:vmId)
  field(:vmIp)
  field(:vmLiveness)
  field(:vmName)
  field(:vmStatus)
  field(:vmZoneName)
end

defimpl Poison.Decoder, for: GoogleApi.AppEngine.V1.Model.Instance do
  def decode(value, options) do
    GoogleApi.AppEngine.V1.Model.Instance.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AppEngine.V1.Model.Instance do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
